-- SceneConfig.lua
-- 场景配置管理 - 现在有关卡顺序

local SceneConfig = {}

-- 场景定义（有关卡顺序）
SceneConfig.SCENES = {
    {
        id = "OutdoorScene",
        displayName = "户外关卡",
        type = "outdoor",
        nextScene = "LevelScene",  -- 下一个场景是室内关卡
        prevScene = nil,
        bounds = { left = 0, right = 24000, top = 8000, bottom = 0 }
    },
    {
        id = "LevelScene",
        displayName = "室内关卡",
        type = "indoor",
        nextScene = "BossScene",   -- 下一个场景是Boss关卡
        prevScene = "OutdoorScene",  -- 上一个场景是户外关卡
        bounds = { left = 0, right = 24000, top = 8000, bottom = 0 }
    },
    {
        id = "BossScene",
        displayName = "BOSS关卡",
        type = "boss",
        nextScene = "LevelScene",  -- 完成后返回主关卡
        prevScene = "LevelScene",  -- 从主关卡进入
        bounds = { left = 0, right = 2844, top = 1600, bottom = 0 }
    }
}

-- 通过ID获取场景配置
function SceneConfig.getSceneById(sceneId)
    for _, scene in ipairs(SceneConfig.SCENES) do
        if scene.id == sceneId then
            return scene
        end
    end
    return nil
end

-- 获取下一个场景ID
function SceneConfig.getNextSceneId(currentSceneId)
    local scene = SceneConfig.getSceneById(currentSceneId)
    return scene and scene.nextScene or nil
end

-- 获取上一个场景ID
function SceneConfig.getPrevSceneId(currentSceneId)
    local scene = SceneConfig.getSceneById(currentSceneId)
    return scene and scene.prevScene or nil
end

-- 检查是否可以切换到下一个场景
function SceneConfig.canGoNext(currentSceneId)
    return SceneConfig.getNextSceneId(currentSceneId) ~= nil
end

-- 检查是否可以切换到上一个场景
function SceneConfig.canGoPrev(currentSceneId)
    return SceneConfig.getPrevSceneId(currentSceneId) ~= nil
end

return SceneConfig